Video encoding/decoding apparatus and method for color image

ABSTRACT

A video encoding/decoding apparatus and method for color images include a first motion prediction unit that generates a first prediction residue image of an input image on a basis of a first motion prediction result of the input image. An image information detection unit sets a predetermined color component of an R-G-B image to a reference color component and determines whether the input image is a Y-Cb-Cr image or an R-G-B image and whether a color component is the reference color component. A second motion prediction unit performs motion prediction for the first prediction residue image and generates a second prediction residue image if the input image is the R-G-B image and the color component of the input image is not the reference color component.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application claims the priority of Korean Patent Application No.2003-48666, filed on Jul. 16, 2003, in the Korean Intellectual PropertyOffice, the disclosure of which is incorporated herein in its entiretyby reference.

BACKGROUND OF THE INVENTION

1. Field of the Invention

The present invention relates to a video encoding/decoding apparatus forcolor images, and more particularly, to an apparatus and method forperforming optimal encoding/decoding on a basis of color information andresolution information of color images.

2. Description of the Related Art

A conventional video compression method converts an image format such asan R-G-B image into an image format such as a Y-Cb-Cr image suitable tocompression, to obtain a high compression rate. Also, the conventionalvideo compression method reduces chroma (Cb, Cr) components to ¼ oftheir original sizes and encodes the Cb and Cr components to enhancecompression efficiency. However, the conventional video compressionmethod is not suitable for applications requiring high-quality imagerestoration because energy loss is generated due to subsampling of theCb and Cr components and the quality loss of the corresponding imagewhich is generated when R-G-B components are converted into Y-Cb-Crcomponents. To reduce these losses, it is necessary to encode the Cb andCr components with the same resolution as the Y components.

Also, to obtain better quality when encoding the Y-Cb-Cr components, itis necessary to reduce the quality loss of the image by directlyencoding the R-G-B components. However, the conventional videocompression method encodes the R-G-B components using a conventionalY-Cb-Cr encoder without utilizing characteristics existing in the R-G-Bcolor components different from those of Y-Cb-Cr components. Arepresentative example of such a conventional video compression methodis the AVC/H. 264 standard developed by the Joint Video Team of theISO/IEC MPEG and ITU-T VCEG.

However, since an R-G-B component and a Y-Cb-Cr component have differentimage characteristics, encoding efficiency is very low if the R-G-Bcomponent is encoded by the conventional Y-Cb-Cr encoder. For example,the respective components (Y, Cb, and Cr) of a Y-Cb-Cr image have nocorrelation within a same area, while the respective components (R, G,and B) of an R-G-B image have correlation within the same area.

Also, the R, G and B components of the R-G-B image have a similarfrequency characteristic, however, in the Y-Cb-Cr image, the Y componenthas a Luma component that is different from a frequency characteristicof Cb and Cr components having Chroma components due to a processperformed when the R-G-B image is converted into the Y-Cb-Cr image. Assuch, the conventional video compression method has not correctlyreflected characteristics of the R-G-B image and the Y-Cb-Cr image withrespect to encoding. Also, the conventional video compression method hasnot reflected the change of the frequency characteristic according tothe size of an image when encoding.

SUMMARY OF THE INVENTION

The present invention provides a video encoding/decoding apparatus andmethod to enhance the encoding/decoding efficiency of an R-G-B imageusing inter-plane prediction.

The present invention also provides a motion compensation apparatus andmethod to perform effective motion compensation according to colorinformation and resolution information upon video encoding/decoding.

The present invention also provides a deblocking filter to reduce blockefficiency effectively according to color information and resolutioninformation upon video encoding/decoding, and a deblocking filteringmethod therefor.

According to an aspect of the present invention, a video encodingapparatus comprises: a first motion prediction unit generating a firstprediction residue image for an input image on a basis of a first motionprediction result of the input image; an image information detectionunit setting a reference color component among color components of anR-G-B image, determining whether the input image is a Y-Cb-Cr image orthe R-G-B image, and determining whether a color component of the inputimage is the reference color component; and a second motion predictionunit performing motion prediction of the first prediction residue imageand generating a second prediction residue image on a basis of thereference color component if the input image is the R-G-B image and thecolor component of the input image is not the reference color component.

According to another aspect of the present invention, a video encodingmethod, which is performed by an encoder, comprises: generating a firstprediction residue image for an input image on a basis of a first motionprediction result of the input image; setting a reference colorcomponent among color components of an R-G-B image, determining whetherthe input image is a Y-Cb-Cr image or the R-G-B image, and determiningwhether a color component of the input image is the reference colorcomponent; and, if the color component of the input image is thereference color component, performing motion prediction for the firstprediction residue image and generating a second prediction residueimage on a basis of the reference color component if the input image isthe R-G-B image and the color component of the input image is not thereference color component.

According to another aspect of the present invention, a video decodingapparatus comprises: a first restoration unit performing a predeterminedoperation for an encoded image and generating a first prediction residueimage of the encoded image; an image information detection unitdetermining whether the encoded image is an R-G-B image or a Y-Cb-Crimage and whether a color component of the encoded image is a referencecolor component of the R-G-B image; a second restoration unit generatinga second prediction residue image of the encoded image on a basis of thereference color component if the encoded image is the R-G-B image andthe color component of the encoded image is not the reference colorcomponent; a deblocking filter unit reducing a block effect of a decodedimage of an encoded image restored on a basis of the first predictionresidue image and the second prediction residue image.

According to another aspect of the present invention, a video decodingmethod comprises: performing a predetermined operation of an encodedimage and generating a first prediction residue image of the encodedimage; determining whether the encoded image is an R-G-B image or aY-Cb-Cr image and whether a color component of the encoded image is areference color component of the R-G-B image; generating a secondprediction residue image of the encoded image on a basis of thereference color component if the encoded image is the R-G-B image andthe color component of the encoded image is not the reference colorcomponent; and reducing a block effect of a decoded image of an encodedimage restored on a basis of the first prediction residue image and thesecond prediction residue image.

According to another aspect of the present invention, a motioncompensation apparatus, which is included in a decoder or encoder,comprises: an image information detector detecting color information ofan input image; a filter tap selector selecting a length of a filter tapfor compensation on a basis of the color information of the input image;an interpolator interpolating the input image using a filter tap withthe selected length; and a motion compensator performing motioncompensation for the interpolated result.

According to another aspect of the present invention, a motioncompensation method, which is performed by an encoder or decoder,comprises: detecting color information of an input image; selecting alength of a filter tap for interpolation on a basis of the colorinformation of the input image; interpolating the input image using afilter tap with the selected length; and performing motion compensationfor the interpolated result.

According to another aspect of the present invention, a motioncompensation apparatus, which is included in a decoder or encoder,comprises: an image information detector detecting resolution and colorinformation of an input image; a filter tap selector selecting a lengthof a filter tap for interpolation on a basis of the resolutioninformation and the color information of the input image; aninterpolator interpolating the input image using a filter tap with theselected length; and a motion compensator performing motion compensationfor the interpolated result.

According to another aspect of the present invention, a motioncompensation method, which is performed by a decoder or encoder,comprises: detecting resolution information and color information of aninput image; selecting a length of a filter tap for interpolation on abasis of the resolution information and color information of the inputimage; interpolating the input image using a filter tap with theselected length; and performing motion compensation for the interpolatedresult.

According to another aspect of the present invention, a deblockingfilter apparatus, which is included in a video decoder or video encoder,comprises: an image information detector detecting color information ofan image; a deblocking filter selector selecting a length of adeblocking filter tap for reducing block effect of the image on a basisof the color information; a filtering unit filtering the image using adeblocking filter with the selected tap length.

According to another aspect of the present invention, a deblockingfilter selection method, which is performed by a decoder or encoder,comprises: detecting color information of an image; selecting a lengthof a deblocking filer for reducing block effect of the image on a basisof the color information; and filtering the image using a deblockingfilter with the selected length.

Additional aspects and/or advantages of the invention will be set forthin part in the description which follows and, in part, will be obviousfrom the description, or may be learned by practice of the invention.

BRIEF DESCRIPTION OF THE DRAWINGS

These and/or other aspects and advantages of the invention will becomeapparent and more readily appreciated from the following description ofthe embodiments, taken in conjunction with the accompanying drawings ofwhich:

FIGS. 1A and 1B are block diagrams showing structures of video encodingapparatuses according to embodiments of the present invention;

FIG. 2 is a flowchart illustrating a video encoding method according toan embodiment of the present invention;

FIG. 3A is a block diagram showing a structure of a video decodingapparatus according to an embodiment of the present invention;

FIG. 3B is a flowchart illustrating a video decoding method according toan embodiment of the present invention;

FIG. 4 is a block diagram of a motion compensation apparatus thatcompensates for motion on a basis of color information of an imageaccording to an embodiment of the present invention;

FIG. 5 is a flowchart illustrating a method of performing motioncompensation according to color information of an image in accordancewith an embodiment of the present invention;

FIG. 6 is a block diagram of a motion compensation apparatus thatcompensates for motion on a basis of color information and resolutioninformation of an image according to another embodiment of the presentinvention;

FIG. 7 is a flowchart illustrating a method of compensating motion on abasis of color information and resolution information of an imageaccording to another embodiment of the present invention;

FIG. 8 is a view illustrating an interpolation method using a long tabfilter;

FIG. 9 is a view illustrating an interpolation method using a short tabfilter;

FIG. 10 is a view showing a deblocking filter unit;

FIG. 11 is a flowchart illustrating a method of selecting the deblockingfilters according to color information of an image in accordance with anembodiment of the present invention;

FIGS. 12A and 12B show vertical and horizontal boundaries of macroblocks to be input to the deblocking filter;

FIGS. 13A and 13B show image samples of vertical and horizontalboundaries of a 4×4 block;

FIGS. 14A and 14B are graphs showing a simulation result of aninter-plane prediction coding method according to an embodiment of thepresent invention and according to the conventional technique at a samebit rate, respectively; and

FIGS. 15A and 15B are graphs showing a simulation result when coding isperformed using a motion compensation apparatus according to anembodiment the present invention and according to the conventionaltechnique at a same bit rate, respectivley.

DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

Reference will now be made in detail to the embodiments of the presentinvention, examples of which are illustrated in the accompanyingdrawings, wherein like reference numerals refer to the like elementsthroughout. The embodiments are described below to explain the presentinvention by referring to the figures.

FIG. 1A is a block diagram showing a structure of a video encodingapparatus according to an embodiment of the present invention. Referringto FIG. 1A, the video encoding apparatus includes a first motionprediction unit 100, an image information detection unit 110, a secondmotion prediction unit 120, and an encoding unit 130. The first motionprediction unit 100 includes an inter-plane predictor 102, anintra-plane predictor 104, and a prediction residue calculator 106.

The inter-plane predictor 102 and intra-plane predictor 104 of the firstmotion prediction unit 100 perform motion prediction of an input imageon a basis of temporally and spatially adjacent images of the inputimage. The inter-plane predictor 102 performs motion prediction of theinput image using a previously-restored image temporally adjacent to theinput image. The intra-plane predictor 104 performs motion prediction ofthe input image using encoding unit blocks of an input image spatiallyadjacent to the input image. Generally, since an initial input image hasno previously-restored image, the intra-plane predictor 104 performsmotion prediction for the initial input image and the inter-planepredictor 102 performs motion prediction for the following input images.The prediction residue calculator 106 generates a first predictionresidue image using a difference between the input image and a motionprediction result of the inter-plane predictor 102 or the intra-planepredictor 104.

Also, the first motion prediction unit 100 selectively uses filter tapswith different tap lengths according to color information and resolutioninformation of the input image. This will be described in detail laterwith reference to FIGS. 4 through 9.

The image information detection unit 110 determines whether the inputimage is a Y-Cb-Cr image or an R-G-B image. Also, the image informationdetection unit 110 perceives a color component of the input image. Thatis, the image information detection unit 110 determines whether thecolor component of the input image is an R, G, or B component of anR-G-B image, or a Y (Luma), Cb, or Cr (Chroma) component of a Y-Cb-Crimage. Also, the image information detection unit 110 sets a specificcolor component among color components of the R-G-B image to a referencecolor component. That is, one among the R, G and B components may be setto the reference color component. Hereinafter, as an example, it isassumed that the G component is set to the reference color component.

The second motion prediction unit 120 performs motion prediction for thefirst prediction residue image output from the first motion predictionunit 100 on a basis of the reference color component and generates asecond prediction residue image if an input image is the R-G-B image anda color component of the input image is not the reference colorcomponent of the R-G-B image. The reference color component used by thesecond prediction unit 120 is received, encoded and decoded before acurrent input image is received. In detail, the second motion predictionunit 120 performs motion prediction on a basis of a prediction residueimage of the reference color component encoded and decoded.

For example, if the reference color component is a G component and acolor component of an input image is a B component, the first motionprediction unit 100 generates a first prediction residue for the B and Gcomponents on a basis of a motion prediction result of the input image.Also, the image information detection unit 110 determines whether theinput image is an R-G-B image and whether the color component of theinput image is a different color component (for example, a B component)from the reference color component (a G component). The second motionprediction unit 120 performs inter-plane prediction for the firstprediction residue image of the input image (a B component) on a basisof a first encoded prediction residue image of the reference colorcomponent (a G component) encoded and then decoded, and generates asecond prediction residue image. That is, the input image with the Bcomponent is subjected to prediction twice by the first motionprediction unit 100 and the second motion prediction unit 120.

The encoding unit 130 encodes the first prediction residue imagegenerated by the first motion prediction unit 100 and the secondprediction residue image generated by the second motion prediction unit120, and generates a bitstream. In detail, the encoder 130 performs aDiscrete Cosine Transform (DCT) or a Discrete Integer Transform 132 ofthe prediction residue images, performs quantization andentropy-encoding of the transformed values, and generates an encodedimage (bitstream).

Since a Y-Cb-Cr image is converted from an R-G-b image using a colorcoordinate transform method, the Y-Cb-Cr image and the R-G-B image havedifferent characteristics in terms of encoding. That is, the respectiveY, Cb, and Cr components of the Y-Cb-Cr image are not correlated witheach other at the same spatial location, while the respective componentsof the R-G-B image are correlated with each other. Accordingly, thevideo encoding apparatus, according to an embodiment of the presentinvention, uses a different prediction method when encoding inaccordance with whether an input image is an R-G-B image or a Y-Cb-Crimage.

As a result, the video encoding apparatus, according to an embodiment ofthe present invention, sets one of the color components of an R-G-Bimage to a reference color component and encodes the reference colorcomponent using the conventional encoding method. Also, the videoencoding apparatus predicts the remaining two color components, exceptfor the reference color component of the R-G-B image, using spatiallyadjacent pixels or temporally adjacent pixels, and then performsprediction of the predicted result once more on a basis of the referencecolor component.

FIG. 1B is a block diagram showing a structure of a video encodingapparatus according to another embodiment of the present invention.Referring to FIG. 1B, the video encoding apparatus, according to anembodiment of the present invention, includes a first motion predictionunit 100, an image information detection unit 110, a second motionprediction unit 120, an encoding unit 130, a first restoration unit 140,a second restoration unit 150, and a deblocking filter unit 160. Thefirst motion prediction unit 100 includes an inter-plane predictor 101,an intra-plane predictor 104, and a prediction residue calculator 107.

An input image (F(n)) 170 is a Y-Cb-Cr image or an R-G-B image. Eachblock of the input image 170 is processed by the video encodingapparatus according to an embodiment of the present invention. The firstmotion prediction unit 100 includes an inter-plane predictor 101 whichhas a motion estimator (ME) 102 and a motion compensator (MC) 103 toestimate and predict motion on a basis of a previously-restored image(Fr(n−1)) 172 to enhance encoding efficiency, and an intra-planepredictor 104 which has a spatial estimator (SE) 105 and a spatialpredictor (SP) 106 to estimate and predict motion on a basis ofspatially adjacent blocks.

An interpolation method of motion compensation is changed according tothe respective color components of Y-Cb-Cr (or Y-U-V) images and R-G-Bimages. First, the prediction residue calculator 107 obtains an encodedprediction residue image ΔF(n) on a basis of the input image 170 and themotion prediction results obtained by the inter-plane predictor 101 orthe intra-plane predictor 104. If the input image 170 is a Y-Cb-Crimage, the prediction residue calculator 107 obtains prediction residuesΔY(n), ΔU(n) and ΔV(n) using the prediction residue image ΔF(n). If theinput image 170 is an R-G-B image, the prediction residue calculator 107obtains prediction residues ΔR(n), ΔG(n) and ΔB(n) using the predictionresidue image ΔF(n).

The encoding unit 130 performs a DCT (or a Discrete Integer Transform),quantization and entropy encoding of the prediction residues ΔY(n),ΔU(n) and ΔV(n) of the Y-Cb-Cr image or the prediction residue ΔG(n) ofthe R-G-B image, thus compressing the prediction residues.

If the input image 170 is an R-G-B image, a prediction residue predictor(RP) 122 of the second motion prediction unit 120 performs inter-planeprediction of the prediction residues ΔB(n) and ΔR(n) of R and Bcomponents, using a prediction residue ΔGr(n) 124 of a restored Gcomponent.

Also, the encoding unit 130 performs a DCT (or a Discrete IntegerTransform), quantization, and entropy encoding of prediction residueimages ΔB′ and ΔR′(n) obtained through the inter-plane prediction, thuscompressing the prediction residue images. The DCT is defined by theISO/IEC MPEG-4 part 2 standard and the Discrete Integer Transform isdefined by the AVC/H. 264 standard developed by the Joint Video Team ofthe ISO/IEC MPEG and ITU-T VCEG.

The first restoration unit 140 performs dequantization of the image (tobe restored) transformed and quantized by the encoding unit 130 so thatthe image may be used for prediction using spatially adjacent blocks ortemporally following images, and then performs an Inverse DiscreteCosine Transform (IDCT) of the image, thus generating prediction residueimages for the respective color components of the image.

The first restoration unit 140 obtains restored prediction residueimages ΔYr(n), ΔUr(n) and ΔVr(n) if the image to be restored is aY-Cb-Cr image. Also, the first restoration unit 140 obtains restoredprediction residue images ΔGr(n), ΔB′r(n) and ΔR′r(n) if the image to berestored is an R-G-B image. The prediction residue image ΔGr(n) isstored in a buffer 124 and undergoes inter-plane prediction by thesecond motion prediction unit 120.

If color components of the image to be restored are R and B components,the second restoration unit 150 obtains restored prediction residueimages ΔBr(n) and ΔRr(n) of the R and B components using the restoredprediction residue image ΔGr(n) of the G component. The restoredprediction residue images ΔYr(n) ΔUr(n) and ΔVr(n) of the Y-Cb-Cr imageor the restored prediction residue images ΔGr(n) and ΔBr(n) of the R-G-Bimage are input as an input Fr(n) to the deblocking filter 160.

The deblocking filter (loop filter) unit 160 adds the input Fr(n) to theinter-plane or intra-plane prediction results generated by the firstmotion prediction unit 100, and filters the added result, thus reducinga block effect. The deblocking filter unit 160 according to anembodiment of the present invention uses different filter tap lengths atblock boundary areas according to the respective components of theY-Cb-Cr (or Y-U-V) image and the R-G-B image. This will be described indetail with reference to FIGS. 10 and 11.

FIG. 2 is a flowchart illustrating a video encoding method according toan embodiment of the present invention. Referring to FIGS. 1A and 2, thefirst motion prediction unit 100 performs temporal/spatial prediction(inter-plane prediction/intra-plane prediction) for an input image, inoperation S200. The image information detection unit 110 sets a Gcomponent as a reference color component of an R-G-B image anddetermines whether the input image is an R-G-B image, in operation S210.If the input image is an R-G-B image, the image information detectionunit 110 determines whether the color component of the input image isthe G component which is being utilized as the reference colorcomponent, in operation S220. If the color component of the input imageis an R or B component, the second motion prediction unit 120 performsinter-plane prediction on the respective components using a predictionresidue image of a restored G component in operation S306. In otherwords, the video encoding method, according to an embodiment of thepresent invention, performs motion prediction for different colorcomponents, except for the reference color component, using the firstmotion prediction unit 100, and then performs motion prediction for thedifferent color components on a basis of the reference color component.The prediction residue images obtained by the first motion predictionunit 100 or the second motion prediction unit 110 are compressed by aDCT (or Discrete Integer Transform), quantization, and entropy encoding.

Hereinafter, the intra-plane prediction applied to the R and Bcomponents except for the reference color component of the R-G-B imagewill be described in more detail. First, motion prediction is performedon an input image with a G component using the input image, and aprediction residue image ΔG of the G component is obtained from thedifference between the result of the motion prediction and the inputimage. This prediction residue image ΔG may be expressed by equation 1:ΔG=G−Gp  (1).

Here, Gp is a value predicted using a G component image spatiallyadjacent to the G component or a G component image temporally adjacentto the G component. The prediction residue image is subjected to entropyencoding.

There is still a significant correlation between the G, R, and Bcomponents, compared to the Y, Cr, and Cb components. To use similaritybetween the G component and the R and B components, the R and Bcomponents are temporally and spatially predicted in accordance with thetemporal and spatial prediction of the G component. Accordingly,prediction residue images ΔR and ΔG are obtained as follows:ΔR=R−Rp  (2)ΔB=B−Bp  (3).

Here, Rp and Bp are prediction residue values of the R and B componentspredicted using their spatially or temporally adjacent images. Theprediction residue values are subtracted by a linearly-transformed valueof an encoded and decoded prediction residue image of the G component,so that inter-plane predicted residue images ΔR′ and ΔG′of the R and Bcomponents are obtained as in the following equations 4 and 5:ΔR′=ΔR−f(ΔGr)=ΔR−(a·ΔGr+b)  (4)ΔB′=ΔB−f(ΔGr)=ΔB−(c·ΔGr+d)  (5).

These data values are smaller, and thus require less encoding comparedto the temporal/spatial prediction residues ΔR and ΔB of the R and Bcomponents, so that encoding efficiency may be enhanced because theprediction residue images ΔR and ΔB may be approximated to a function ofΔG by expressing a relationship between the prediction residues ΔG andΔR and a relationship between the prediction residues ΔG and ΔB by alinear function using a fact that there is a significant correlationbetween the prediction residue images ΔG, ΔR, and ΔB. Hereinafter,values a and b (equations 6 and 7) are a gradation and a deviation ofthe approximated linear function when the prediction residue of the Rcomponent is predicted using the prediction residue of the G component,and values c and d (equations 8 and 9) are a gradient and a deviation ofthe approximated linear function when the prediction residue of the Bcomponent is predicted using the prediction residue of the G component.

$\begin{matrix}{a = \frac{{cov}\left( {{\Delta\; G},{\Delta\; R}} \right)}{\sigma_{\Delta\; G}^{2}}} & (6)\end{matrix}$b=E(ΔR)−α·E(ΔG)  (7)

$\begin{matrix}{c = \frac{{cov}\left( {{\Delta\; G},{\Delta\; B}} \right)}{\sigma_{\Delta\; G}^{2}}} & (8)\end{matrix}$d=E(ΔB)−c·E(ΔG)  (9)

Here, cov(·) is a covariance, E(·) is an average of the values, and σ²is a variance.

FIG. 3A is a block diagram showing a structure of a video decodingapparatus according to an embodiment of the present invention. Referringto FIG. 3A, the video decoding apparatus includes a first restorationunit 300, an image information detector 310, a second restoration unit320, a motion prediction unit 330, and a deblocking filter 340.

The video decoding apparatus, according to an embodiment of the presentinvention, restores an image from a compressed bitstream (that is, anencoded image). The first restoration unit 300 performs entropy decoding302, dequantization 304, and an inverse discrete integer transform 306of the compressed bitstream (data), and obtains restored predictionresidue images ΔYr(n), ΔUr(n) and ΔVr(n) of the respective components ofa Y-Cb-Cr image if the compressed bitstream is the Y-Cb-Cr image.Meanwhile, the first restoration unit 300 obtains restored predictionresidue images ΔGr(n), ΔB′r(n) and ΔR′r(n) if the compressed bitstreamis an R-G-B image.

The image information detector 310 determines whether the compressedbitstream is a Y-Cb-Cr image or an R-G-B image, and whether a colorcomponent of the compressed bitstream is a reference color component ofan R-G-B image. Hereinafter, in the following example, it is assumedthat a G component is set to the reference color component.

If the compressed bitstream is a Y-Cb-Cr image or a reference colorcomponent of an R-G-B image, a prediction residue image restored by thefirst restoration unit 300 is a prediction residue image ΔFr(n) 352 tobe input to the motion prediction unit 330.

The second restoration unit 320 stores a prediction residue image ΔGr(n)of the G component for inter-plane prediction to restore predictionresidue images of R and B components if the compressed bitstream is a Bor R component (that is, a different component other from the referencecolor component) of the R-G-B image.

Meanwhile, if a bitsteam is encoded by the inter-plane prediction of thevideo encoder FIGS. 1A and 1B), the second restoration unit 320 adds aninter-plane predicted value of a previous image Fr(n−1) obtained by a MC(motion comparator) 332 of the motion prediction unit 330 with aprediction residue image obtained by the first restoration unit 300 andthe second restoration unit 320, and obtains restored values of therespective components of the R-G-B or Y-Cb-Cr image. If the bitstream isencoded by the intra-plane prediction, the second restoration unit 320adds intra-plane prediction values obtained by a SP (spatial predictor)334 of the motion predictor 330 with a prediction residue image obtainedby the first restoration unit 330 and the second restoration unit 320,and obtains restored values of the respective components of the R-G-B orY-Cb-Cr image. Here, the inter-plane prediction of the motion predictionunit 330 is performed using different interpolation methods upon motioncompensation, according to the respective components of the Y-Cb-Cr (or,Y-U-V) image and the R-G-B image. This will be described in more detailwith reference to FIGS. 4 through 9. The values restored by the secondrestoration unit 320 are passed through the deblocking filter 340 forreducing a block effect and are output as restored images Fr(n) 352 ofthe respective color components.

The deblocking filter unit 340 selectively uses deblocking filter withdifferent filter tap lengths, which are used at block boundaries,according to the respective components of the Y-Cb-Cr (or, Y-U-V) imageand the R-G-B image. This will be described with reference to FIGS. 10and 11.

FIG. 3B is a flowchart illustrating a video decoding method according toan embodiment of the present invention. Referring to FIGS. 3A and 3B,the first restoration unit 300 generates a first prediction residueimage from the bitstream in operation S350. Also, the image informationdetector 310 determines whether the bitstream is a Y-Cb-Cr image or anR- G-B image and whether a color component of the bitstream is areference color component of the R-G-B image, in operation S355.

If the bitstream is an R-G-B image and the color component of thebitstream is not a reference color component of the R-G-B image, thesecond restoration unit 320 predicts the first prediction residue imageobtained by the first restoration unit 300 using the first predictionresidue image of the reference color component, and generates a secondprediction residue image, in operation S360.

The second restoration unit 320 adds the first and second predictionresidue images with the motion prediction result of the previous imageobtained by the motion predictor 330, and obtains a restored image, inoperation S365. The deblocking filter unit 340 reduces a block effect ofthe restored image and obtains a final restored image Fr(n) 352 inoperation S370.

FIG. 4 is a block diagram showing a structure of a motion compensationapparatus according to an embodiment of the present invention. Referringto FIG. 4, the motion compensation apparatus 103 or 332 includes animage information detector (not shown), a filter tap selector 400,interpolators 410 and 420, and a motion compensator 430.

R, G, and B components of an R-G-B image have a similar frequencycharacteristic, but in a Y-Cb-Cr image, a Y component which is a lumacomponent is different from a frequency characteristic of Cb and Crcomponents which are chroma components. Also, the chroma components ofthe Y-Cb-Cr image have a plurality of low frequency components andsignificant correlation therebetween, compared to the luma component.FIG. 4 is a block diagram of a motion compensation apparatus using adifferent prediction method according to color components of an image.

The image information detector (not shown) determines whether an inputimage is a Y-Cb-Cr image or an R-G-B image and whether a color componentof the input image is a reference color component of an R-G-B image.Generally, the reference color component of the R-G-B image is set to aG component.

The filter tap selector 400 selects a long tap filter interpolator 410or a short tap filter interpolator 420 according to color componentinformation 402 of an input image received from the image informationdetector (not shown). That is, the filter tap selector 400 selects afilter tap for optimal motion prediction according to the respectivecolor components of the input image. In this disclosure, a long tapfilter may be a 6 tap filter and a short tap filter may be a 2 tapfilter.

For example, the filter tap selector 400 selects a 6 tap filterinterpolator if the input image is the Y-Cb-Cr image or if the colorcomponent of the input image is not the reference color component of theR-G-B image, and selects a 2 tap filter interpolator if the colorcomponent of the input image is the reference color component of theR-G-B image.

The interpolator 410 or 420 selected by the filter tap selector 400interpolates the input image to perform motion compensation of the inputimage. At this time, each of the interpolators 410 and 420 interpolatesthe input image on a basis of a motion vector 412 of a previous frame.

Alternatively, the interpolators 410 and 420 may be a 6 tap filterinterpolator 410 and a bilinear interpolator 420, respectively. If thefilter tap selector 400 selects the 6 tap filter interpolator 410, the 6tap filter interpolator 410 interpolates the input image. The inputimage interpolated by the interpolator 410 or 420 undergoes motioncompensation by the motion compensator 430.

FIG. 5 is a flowchart illustrating a method of performing motioncompensation according to a color component of the input image,according to an embodiment of the present invention. Referring to FIGS.4 and 5, the filter tap selector 400 selects a filter tap based on acolor component received from the image information detector (notshown), in operation S500. If it is determined in operation S510 thatthe color component of the input image is an R-G-B component, the filtertap selector 400 selects the same interpolation method for therespective component of the R-G-B image in operation S520. For example,the filter tap selector 400 allows all the respective components of theR-G-B image to be passed through the long tap filter interpolator 410 orallows all the respective components of the R-G-B image to be passedthrough the short tap filter interpolator 420.

If it is determined that the color component of the input image is notan R-G-B component and is a Y-Cb-Cr component, the image informationdetector (not shown) determines whether the color component of the inputimage is a Y component (Luma) in operation S530. If the color componentof the input image is the Luma component, the filter tap selector 400selects the long tap filter interpolator 410 so that the input image maybe interpolated by the long tap filter interpolator 410 in operationS540. If the color component of the input image is a chroma component(Cb, Cr), the filter tab selector 400 selects the short tap filterinterpolator 420 in operation S550.

The reason of selecting a different tap filter interpolator according tothe color component of the input image is that the long tap filterinterpolation method using a plurality of adjacent pixels may correctlyrestore the high-frequency components, in comparison with the short tapfilter interpolation method, when a plurality of high-frequencycomponents exist in the color component of the input image. On thecontrary, the short tap filter interpolator using the relatively smallnumber of adjacent pixels is more effective in terms of complexity incomparison with maintaining a similar performance with the long tapfilter interpolator if there are more low-frequency components thanhigh-frequency components in the color component of the input image.

FIG. 6 is a block diagram showing a structure of a motion compensationapparatus, according to another embodiment of the present invention.Referring to FIG. 6, the motion compensation apparatus 103 or 332includes an image information detector (not shown), a filter tapselector 600, interpolators 610 and 620, and a motion compensator 630.

Size or resolution information 604 of an image, as well as the colorcomponent 602 of the image influences the frequency characteristic. FIG.6 is a block diagram of a motion compensation apparatus which uses adifferent motion compensation method according to color information andresolution information of an image in accordance with another embodimentof the present invention.

An image information detector (not shown) perceives color components andresolution information of an input image. In detail, the imageinformation detector (not shown) determines whether the input image is ahigh-resolution image or a low-resolution image and whether the colorcomponent of the input image is the reference color component of theR-G-B image.

The filter tap selector 600 selects the length of a filter tap accordingto the color information and the resolution information of the inputimage perceived by the image information detector (not shown). Indetail, the filter tap selector 600 selects a short tap filter if theinput image is a high-resolution image or if the color component of theinput image is a different color component from a Y component (Luma) ofa Y-Cb-Cr image. Also, the filter tap selector 600 selects a long tapfilter if the input image is a low-resolution image, if the input imageis an R-G-B image, or if the color component of the input image is the Ycomponent (Luma) of the Y-Cb-Cr image. Generally, the long tap filter isa 6 tap filter, and the short tap filter is a 2 tap filter.

There are an interpolator 610 (also, referred to as a long tap filterinterpolator) using a long filter tap and an interpolator 620 (also,referred to as a short tap filter interpolator) using a short filtertap, and the interpolators 610 and 620 interpolate image informationcorresponding to a motion vector (MV) of a previous frame. The motioncompensator 630 compensates for motion of the input image interpolatedby the interpolators.

FIG. 7 is a flowchart illustrating a motion compensation methodaccording to another embodiment of the present invention. In detail,FIG. 7 is a flowchart illustrating a method of performing motioncompensation using color components and resolution information.Referring to FIGS. 6 and 7, the image information detector (not shown)receives image size information of an input image in operation S700 anddetermines whether the input image is a high-resolution image inoperation S710. In the present invention, the high-resolution imagerefers to an image with a size greater than an image size of 1280×720 asthe HD resolution level. A reference image size of 1280×720 may bechanged according to environments and applications.

If the input image is a high-resolution image, the filter tap selector600 selects the short tap filter interpolator in operation S750 becauseit is unnecessary to use a long tap filter, since more low frequencycomponents than high frequency components are included in thehigh-resolution image. In the case of the high-resolution image, since asmall portion of an actual image is displayed by a great number ofpixels, differences between pixel values are small. In this case, sincea video quality difference between when the long tap filter is used andwhen the short tap filter is used is small, the filter tap selector 600selects the short tap filter interpolator 620 since the short tap filterhas less complexity.

If the input image is a low-resolution image, the image informationdetector (not shown) receives color information in operation S700 anddetermines whether the input image is an R-G-B image in operation S720.If the color component of the input image is a R, G, or B component inoperation S730, the filter tap selector 600 selects the long tap filterinterpolator 610 so that all the respective components of the inputimage may be interpolated by the long tap filter interpolator 610. Ifthe color component of the input image is not the R, G, or B componentand is a Y, Cb, or Cr component, the image information detector (notshown) determines whether the color component of the input image is a Ycomponent (Luma) in operation S730. If the color component of the inputimage is the Luma component, the filter tap selector 600 selects thelong tap filter interpolator 610 in operation 740. If the colorcomponent of the input image is a chroma component, the filter tapselector 600 selects the short tap filter interpolator in operationS750.

FIG. 8 shows an example in which the 6 tap filter is used when an imageof a previous frame is interpolated four times in a vertical or ahorizontal direction for motion compensation. The 6 tap filter isdefined by the MPEG-4 AVC/H.264. Referring to FIG. 8, when pixels Athrough U of a previous frame are given, pixels a through s, which arelocated in a ¼ or ½ pixel position, may be obtained according to theequations set forth below.

First, the pixels b and h to be located in the ½ pixel position, whichis located in a vertical or horizontal direction from correspondingpixels, are interpolated using 6 adjacent pixels as follows.b1=(E−5xf+20xg+20xh−5xI+J)  (10)h1=(A−5xC+20xG+20xM−5xR+T)  (11)b=Clip1((b1+16)>>5)  (12)h=Clip1((h1+16)>>5)  (13)

Here, Clip1(x) means to clip a value x to a predetermined size so thatthe value x is within a bit range of the image pixels. In the case inwhich an input image is a 8-bit image, the value x of Clip1(x) is set to0 if x is smaller than 0. If x is greater than 255, x is set to 255, andthe remaining values are maintained as they are. A filter tap used forinterpolation is a 6 tap filter (1, −5, 20, 20, −5, 1) which uses arelatively large number of adjacent pixels.

A pixel j to be located in a ½ pixel position is interpolated in avertical and horizontal direction, using the previously-restoredadjacent pixels corresponding to the ½ pixel position, according toequations 14a, 14b and 15.j1=cc−5×dd+20×h1+20×m1−5×ee+ff  (14a)j1=aa−5×bb+20×b1+20×s1−5×gg+hh  (14b)j=Clip1((j1+512)>>10)  (15)

Here, cc, dd, h1, m1, ee, ff, or aa, bb, b, s1, gg, and hh, as adjacentpixel values, are intermediate results obtained by performinginterpolation by the 6 tap filter as in the above equations 10 and 11.

The pixel values s and m as final values, which are located in the ½pixel position, are values restored from the pixel values s1 and m1according to the equations 12 and 13.

The pixel values a, c, d, n, f, i, k and q, which are located in the ¼pixel position, are values obtained by averaging two pixels adjacent ina vertical or horizontal direction, as in the following equations 16through 23.a=(G+b+1)>>1  (16)c=(H+b+1)>>1  (17)d=(G+h+1)>>1  (18)n=(M+h+1)>>1  (19)f=(b+j+1)>>1  (20)i=(h+j+1)>>1  (21)k=(j+m+1)>>1  (22)q=(j+s+1)>>1  (23)

The pixel values e, g, p, and r, which are located in the ¼ pixelposition, are values obtained by averaging two pixels adjacent in adiagonal direction, as in equations 24 through 27.e=(b+h+1)>>1  (24)g=(b+m+1)>>1  (25)p=(h+s+1)>>1  (26)r=(m+s+1)>>1  (27)

FIG. 9 shows an example using a bilinear interpolation method (using ashort tap filter) when an image of a previous frame is interpolated fourtimes in a vertical or horizontal direction, to compensate for motion.This bilinear interpolation method is defined by the MPEG-4 AVC/H.264.

In the pixels A, B, C, and D of the previous frame, a pixel value whichis located in a ¼ or ½ pixel position may be obtained by equation 28a.a=((4−dx)×(4−dy)×A+dx×(4−dy)×B+(4−dx)×dy×C+dx×dy×D+8)>>4  (28a)

Here, dx is a value representing, with a ¼ pixel position, a distance bywhich the pixel a is separated in a horizontal direction from the pixelA or C, and dy is a value representing, with a ¼ pixel position, adistance by which the pixel a is separated in a vertical direction fromthe pixel A or B.

Referring to FIG. 9, the bilinear interpolation method uses a relativelysmall number of adjacent pixels and uses pixel values located near avalue to be interpolated, and differs from the method shown in FIG. 7.

FIG. 10 is a block diagram showing a structure of a deblocking filterunit which uses the characteristics of color components of an image,according to an embodiment of the present invention. The characteristicsof the color components of an image are used by the deblocking filterunit for reducing a block effect generated after image restoration, aswell as being used for motion compensation. FIG. 10 shows an embodimentof a deblocking filter which utilizes the color componentcharacteristics of an image.

Referring to FIG. 10, a deblocking filter unit 160 or 340 includes animage information detector (not shown), a deblocking filter selector1000, a long tap loop (deblocking) filter 1010, and a short tap loop(deblocking) filter 1020. The image information detector (not shown)determines whether an input image is a Y-Cb-Cr image or an R-G-B imageand whether a color component of the input image is a luma (Y)component.

The deblocking filter selector 1000 selects one of the long tap loopfilter and short tap loop filter 1010 and 1020 each with a differentfilter tap length, on a basis of the color component of the input image.For example, the deblocking filter selector 1000 selects the long taploop filter 1010 if the input image is the R-G-B image or if the colorcomponent of the input image is the luma (Y) component of the Y-Gb-Grimage. Also, the deblocking filter selector 1000 selects the short taploop filter 1020 if the color component of the input image is a chroma(Cb or Cr) component of the Y-Cb-Cr image.

The long tap loop filter 1010 has a different filter tap length fromthat of the short tap loop filter 1020. One of the long tap loop filter1010 and the short tap loop filter 1020 is selected by the deblockingfilter selector 1000.

Each of the long tap loop filter and short tap loop filter 1010 and 1020determines whether filtering should be performed, on a basis of a blockencoding mode, a CBP (Coded Block Pattern), reference image numbers formotion information (MV, MC) of a previous frame, and field informationin a case of an interlaced image, and finally removes a block effect ofthe input image.

FIG. 11 is a flowchart illustrating a method of selecting a deblockingfilter tap according to a color component of an input image inaccordance with an embodiment of the present invention. Referring toFIGS. 10 and 11, the deblocking filter selector 1000 receives colorinformation from the image information detector (not shown), anddetermines whether a color component of the input image is a colorcomponent of an R-G-B image in operation S1110. If the color componentof the input image is the color component of the R-G-B image, thedeblocking filter selector 1000 allocates the same filter tapcoefficient to each of the color components in operation 1130. In thiscase, the deblocking filter selector 1000 generally selects the long taploop filter 1010. If the color component of the input image is a colorcomponent of the Y-Cb-Cr image, the filter tap selector 1000 selects thelong tap filter 1010 in operation S1140. If the color component of theinput image is a chroma component, the filter tap selector 1000 selectsthe short tap loop filter 1020 in operation S1150.

FIGS. 12A and 12B show vertical and horizontal directional boundaries towhich deblocking filtering is performed to reduce a block effect in a16×16 macro block. Referring to FIG. 12A, a macro block is divided intosixteen 4×4 blocks, each of which is encoded. Therefore, the blockeffect is generated at the boundaries of the 4×4 blocks. As shown inFIG. 12A, first, deblocking filtering is performed to verticalboundaries 1201, 1202, 1203, and 1204. Then, as seen in FIG. 12B,deblocking filtering is performed to horizontal boundaries 1205, 1206,1207, and 1208.

FIGS. 13A and 13B show coefficients used when the deblocking filteringis performed to the vertical and horizontal boundaries of the 4×4 block.In the vertical boundaries, as shown in FIG. 13A, to reduce a blockeffect using pixel values of pixels p0, p1, p2, p3, q0, q1, q2, and q3and a filter tap, the pixel values of the pixels p0, p1, p2, q0, q1, q2are changed. FIG. 13B shows pixels to whose horizontal boundariesdeblocking filtering is performed.

Since a loss level is different for each 4×4 block, it is necessary tochange filter coefficients and determine whether filtering should beperformed for each 4×4 block. For that, as shown in FIG. 10, whetherdeblocking filtering should be performed, that is, the length of filtertap, and the like, are decided using a predetermined threshold value, ona basis of a block encoding mode, a CBP (Coded Block Pattern), referenceimage numbers for motion information (MV, MC) of a previous frame, andfield information in a case of an interlaced image. As a basic filtermethod, a filtering method defined by the MPEG-4 AVC/H.264 is used. Avalue filterFlag for deciding whether filtering should be performedusing a 4×4 block may be calculated by equation 28b.filterFlag=(Bs!=0&&Abs(p0−q0)<α&&Abs(p1−p0)<βAbs(q1−q0)<β)  (28b)

Here, deblocking filtering is performed only when the value filterFlagis 1. α and β are threshold values for deciding whether the deblockingfiltering should be performed according to a change of adjacent pixelvalues. The threshold values α and β become greater as a quantizationvalue increase. Bs (filter strength) is a value indicating a range ofpixel values to be changed through the filter when the deblockingfiltering is performed. The value Bs has a value between 0 through 4. Ifthe value Bs is 0, filtering is not performed. As the value Bsapproaches 4, the value of filter coefficients becomes greater. Thevalue Bs is changed so that a majority of pixels among the pixels p0,p1, p2, p3, q0, q1, q2, q3 reduce a block effect.

First, long tap filter coefficients used when the color component is aR, G, and B component or a Y component of a Y-Cb-Cr image, may bedefined by equations 29 through 45.

If the value Bs is smaller than 4, the pixels p0 and q0 most adjacent tothe boundary are changed to p′0 and q′0 as follows.Δ=Clip3(−tc,tc,((((q0−p0)<<2)+(p1−q1)+4)>>3))  (29)p′0=Clip1(p0+Δ)  (30)q′0=Clip1(q0−Δ)  (31)

Here, Clip3(min, max, x) is defined to locate a value x between aminimum value min and a maximum value max. Clip1(x) has the same meaningas Clip1(x) of equation 12. tc is a threshold value for limiting a pixelvalue. Here, if the value Bs is large, tc also has a large value, whichmakes a changing level of a pixel value larger.

In the case of p1 and q1, the following values are defined to decidewhether filtering should be performed.ap=abs(2p−p0)  (32)aq=abs(q2−q0)  (33)

Here, if ap is smaller than β, p1 is changed to p′1. Otherwise, p1 isnot changed.p′(1)=p1+Clip3(−tc, tc, (p2+((p0+p0+1)>>1)−(p1<<1)>>1)  (34)

Here, q1 is changed to q′1 if aq is smaller than β, as follows.Otherwise, q1 is not changed.q′1=q1+Clip3(−tc, tc, (q2+((q0+q0+1)>>1)−(q1>>1)  (35)

If Bs is 4, values Tp and Tq for deciding filter coefficients aredefined as follows.Tp=ap<β&&Abs(p0−q0)<((α>>2)+2)  (36)Tq=aq<β&&Abs(p0−q0)<((α>>2)+2)  (37)

If Tp is 1, p0, p1, and p2 are changed respectively to p′0, p′1, and p′2by increasing the value of filter coefficients, as follows.p′0=(p2+2xp1+2xp0+2xq0+q1+4)>>3  (38)p′1=(p2+p1+p0+q0+2)>>2  (39)p′2=(2xp3+3xp2+p1+p0+q+4)>>3  (40)

Meanwhile, if Tp is 0, only p0 is changed to p′0 by decreasing the valueof the filter coefficients.p′0=(2xp1+p0+q1+2)>>2  (41)

Meanwhile, if Tq is 1, q0, q1, and q2 are changed respectively to q′0,q′1, and q′2 by increasing the value of the filter coefficients asfollows.q′0=(p1+2xp0+2xq0+2xq1+q2+4)>>3  (42)q′1=(p0+q0+q1+q2+2)>>2  (43)q′2=(2xq3+3xq2+q1+q0+p0+4)>>3  (44)

Meanwhile, if Tq is 0, only q0 is changed to q′0 by decreasing the valueof filter coefficients as follows.q′0=(2xq1+q0+p1+2)>>2  (45)

If the color component of the Y-Cb-Cr image is a Cb or Cr component, theshort tap filter coefficients are determined as follows. First, if Bs issmaller than 4, p0 and q0 are changed to p′0 and q′0, respectively,according to equations 30 and 31. Differently from the R-G-B image andthe Y component, the values of p1 and q1 are not changed. If Bs is 4,only the values of p0 and q0 are changed to p′0 and q′0, respectively,according to equations 41 and 45. Differently from the R-G-B image andthe Y component, the values of p1 and q1 are not changed.

FIG. 14A is a graph showing a simulation result of video encoding usingan inter-plane prediction coding method according to an embodiment ofthe present invention when an R-G-B image is provided as an input image.FIGS. 14A and 14B show a comparison result of when the inter-planeprediction according to an embodiment of the present invention is usedand when the inter-plane prediction is not used, respectively. Here, aninput image is a CREW image with a 1280×720 size, and the simulationresult is represented with PSNR at four bit rates.

FIG. 14A shows a simulation result in an intra mode that performs onlyspatial prediction, and FIG. 14B shows a simulation result when temporalprediction and spatial prediction are used. As shown in FIGS. 14A and14B, there is more than 3 dB gain difference between the presentinvention and the conventional technique at a same bit rate.

FIG. 15A shows a comparison result for a 640×350 Harbour image, betweena case (MC_LL) where a 6 tap filter is used for motion compensation anda case (MC_LC) where the 6 tap filter is used for G components and thebilinear filter is used for R and B components, when an R-G-B image isused as an input image

It is seen in FIG. 15A that in the MC_LL method, according to anembodiment of the present invention, a PSNR gain is higher than that ofthe conventional technique at a same bit rate.

FIG. 15B shows a comparison result for a 640×352 Harbour image, betweena case (MC_LC) where the 6 tap filter is used for Y components and theBilinear filter is used for Cb and Cr components and a case (MC_LL)where the 6 tap filter is used for all of Y, Cb and Cr components formotion compensation, when a Y-Cb-Cr image is used as an input image. Itis seen in FIG. 15B that in the present invention, PSNR is improved at asame bit rate for each Y, Cb, and Cr component.

The present invention may be embodied as a program stored on a computerreadable medium that can be run on a general computer. Here, thecomputer readable medium includes, but is not limited to, storage mediasuch as magnetic storage media (e.g., ROM's, floppy disks, hard disks,and the like), optically readable media (e.g., CD-ROMs, DVDs, etc.), andcarrier waves (e.g., transmission over the Internet). The presentinvention may also be embodied as a computer readable program code unitstored on a computer readable medium, for causing a number of computersystems connected via a network to affect distributed processing.

As described above, the present invention may efficiently encode anddecode video data considering color component characteristics of aninput image. In particular, it is possible to improve encodingefficiency of an R-G-B image through inter-plane prediction. The presentinvention may be applied to Digital Archive, digital cinema, and thelike, requiring image information with high-quality since R-G-B imagesare directly encoded.

Also, the present invention utilizes all of color componentcharacteristics and image resolution characteristics for motioncompensation and deblocking filtering in an encoder and decoder. Thepresent invention may improve encoding efficiency by enhancing imagequality through filtering according to characteristics of images.Therefore, the present invention may construct a suitable encoder anddecoder in correspondence with respective characteristics of R-G-Bimages and Y-Cb-Cr images.

Although a few embodiments of the present invention have been shown anddescribed, it would be appreciated by those skilled in the art thatchanges may be made in these embodiments without departing from theprinciples and spirit of the invention, the scope of which is defined inthe claims and their equivalents.

1. A video decoding apparatus comprising: a first restoration unitperforming a predetermined operation of an encoded image and generatinga first prediction residue image of the encoded image; an imageinformation detection unit determining whether the encoded image is anR-G-B image or a Y-Cb-Cr image and whether a color component of theencoded image is a reference color component of the R-G-B image; asecond restoration unit generating a second prediction residue image ofthe encoded image, on a basis of the reference color component if theencoded image is the R-G-B image and the color component of the encodedimage is not the reference color component; and a deblocking filter unitreducing a block effect of a decoded image of an encoded image restoredon a basis of the first prediction residue image and the secondprediction residue image.
 2. The video decoding apparatus of claim 1,wherein the first restoration unit performs entropy decoding,dequantization, and an inverse discrete integer transform of the encodedimage, and generates the first prediction residue image.
 3. The videodecoding apparatus of claim 1, wherein the deblocking filter unitselects a filter tap with a predetermined length on a basis of colorinformation of the decoded image and reduces a block effect of thedecoded image using the selected filter tap.
 4. A deblocking filterapparatus, which is included in a video decoder or video encoder,comprising: an image information detector detecting color information ofan image; a deblocking filter selector selecting a length of adeblocking filter tap to reduce a block effect of the image on a basisof the color information; and a filtering unit filtering the image usinga deblocking filter with the selected tap length, wherein the imageinformation detector determines whether the image is a Y-Cb-Cr image oran R-G-B image and whether a color component of the image is a Ycomponent of the Y-Cb-Cr image, and wherein the deblocking filterselector selects a Luma-based deblocking filter if the image is theR-G-B image or if the color component of the image is the Y component,and selects a Chroma-based deblocking filter if the color component ofthe image is a Cb or Cr component.
 5. The deblocking filter apparatus ofclaim 4, wherein the deblocking filter selector selects a 6 tapdeblocking filter if the image is the R-G-B image or if the colorcomponent of the image is the Y component, and selects a 2 tapdeblocking filter if the color component of the image is a Cb or Crcomponent.
 6. The deblocking filter apparatus of claim 4, wherein thefiltering unit determines whether filtering for the image should beperformed, on a basis of a block encoding mode, a coded block pattern, amotion vector of a previous frame, a reference image number of motioncompensation, and field information in a case of an interlaced image. 7.A deblocking filter selection method, which is performed by a decoder orencoder, comprising: detecting color information of an image; selectinga length of a deblocking filer to reduce a block effect of the image ona basis of the color information; and filtering the image using adeblocking filter with the selected length, wherein the detecting theimage information comprises: determining by the decoder or encoderwhether the image is a Y-Cb-Cr image or an R-G-B image and whether acolor component of the image is a Y component of the Y-Cb-Cr image, andwherein the selecting the deblocking filter comprises: selecting by thedecoder or encoder a Luma-based deblocking filter if the image is theR-G-B image or if the color component of the image is the Y component,and selecting a Chroma-based deblocking filter if the color component ofthe image is a Cb or Cr component.
 8. The deblocking filter selectionmethod of claim 7, wherein the selecting the deblocking filtercomprises: selecting a 6 tap deblocking filter if the image is the R-G-Bimage or if the color component of the image is the Y component, andselecting a 2 tap deblocking filter if the color component of the imageis a Cb or Cr component.
 9. The deblocking filter selection method ofclaim 7, wherein the filtering the image comprises: determines whetherfiltering for the image is to be performed on a basis of a blockencoding mode, a coded block pattern, a motion vector of a previousframe, a reference image number of motion compensation, and fieldinformation in a case of an interlaced image.